-- card: 13996 from stack: in -- bmap block id: 15304 -- flags: 0000 -- background id: 12278 -- name: string ----- HyperTalk script ----- on opencard hide card field "prt" hide card field "ans" pass opencard end opencard -- part 2 (button) -- low flags: 00 -- high flags: A003 -- rect: left=317 top=55 right=77 bottom=417 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Demo ----- HyperTalk script ----- on mouseUp ask"Which Mode P,Z,D,X,L,U,V?" if it is empty then exit mouseup show card field "prt" show card field "ans" put (first character of it) & ")" into second item of word 1 of card field "prt" do card field "prt" repeat until the mouseclick put "*" after card field "ans" delete last char of card field "ans" end repeat hide card field "prt" hide card field "ans" end mouseUp -- part 3 (field) -- low flags: 80 -- high flags: 0004 -- rect: left=11 top=67 right=264 bottom=478 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: prt -- part 4 (field) -- low flags: 80 -- high flags: 2004 -- rect: left=11 top=251 right=309 bottom=480 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: ans -- part contents for background part 68 ----- text ----- The String XFCN is a versatile function that provides several options for viewing a range of memory as a string. The general format of the String XFCN is: String(Address,Mode,Ext) Here Address is any even hexadecimal address (optionally preceeded by H). Mode is required and must be one of: P - In this case the data at the given address is interpreted as a Pascal String (i.e. first byte is the length of the string). Z - In this case the data at the given address is interpreted as a C-string (i.e. the string is terminated by a zero byte). Compare the results of the P and Z option using the demo on this card. D - In this case the result is the string consisting of the 4 words starting at the given address in hexadecimal followed by two dashes and the text equivalents of these four words. This produces the effect of a dump (hence the D) that is common to many disassemblers. L- A long dump. It dumps the hex contents of the 8 words stored beginning at the given address, followed by two dashes and then the text equivalents of these values. X - An extra long dump. It dumps the hex contents of the 16 words stored beginning at the given address, followed by two dashes and then the text equivalents of these values. U - produces a hex-dump of the four words stored starting at the given address V - produces a hex-dump of the eight words stored starting at the given address N - Returns the string of 8 characters stored at the given address. Several software products produce names of this length and that is why this option is included here. __________________________________________________________ An alternate version of the string XFCN is String(Address1,Address2) which will dump the hex values of the contents of address1 to address2 folowed by their text equivalents. Note: 1. address1-address2 must be at most 120 (decimal). 2. Address2 MUST be preceeded by an H prefeix. Example: put String(H2E0,H2F0) __________________________________________________________ If a third parameter of any kind is included with the XFCN, then String also returns a second line in its result. The second line contains the next address (in hex) that follows the dumped string. __________________________________________________________ Take a look at the script for the Demo button on this card. It contains a nice example of how to use Hypertalk's 'do' command. -- part contents for background part 69 ----- text ----- The Pascal String is Finder The D option produces 0646 696E 6465 7220 -- Finder the V option produces 0646 696E 6465 7220 2020 2020 2020 2020 the X option produces 0646 696E 6465 7220 2020 2020 2020 2020 0000 0020 0000 0020 FFFF FFFF 0000 1064 -- Finder   ˇˇˇˇd the D,L option produces 0646 696E 6465 7220 -- Finder 2E8 Click the mouse to continue -- part contents for card part 3 ----- text ----- put string("2E0",p) into card field "ans" The contents of the string at address 2E0 (the name of the finder) is displayed below using the format you specified. The blinking asterisk shows you exactly where the string ends. Note that the Z option returns a number of blank spaces which are not present in the string returned by the P option. If you use the X or L option, you can see these blanks displayed in hex as a series of 20's. Click the Mouse to Continue -- part contents for card part 4 ----- text ----- Illegal String Type